On switching to another app (or to another window within the same app) you'll receive App4 and Activate events. This is an ideal time to ask HiliteControl to enable and disable your TextCDEF and ListCDEF controls. In the case of PictCDEFs, you may want to use HiliteControl to "simulate" the pressing of pict-style buttons, but you don't really need to activate/deactivate them on switching out windows or applications.